package com.ruoyi.fly.controller;

import java.util.List;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.fly.domain.AppletVip;
import com.ruoyi.fly.domain.vo.AppletVipVo;
import com.ruoyi.fly.service.AppletVipService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 【请填写功能名称】Controller
 *
 * @author ruoyi
 * @date 2024-06-04
 */
@RestController
@RequestMapping("/vip")
@Api(tags = "VIP管理")
public class AppletVipController extends BaseController {
    @Autowired
    private AppletVipService appletVipService;

    /**
     * 查询【请填写功能名称】列表
     */
    @ApiOperation(value = "查询VIP列表")
    @GetMapping("/list")
    public TableDataInfo list() {
        startPage();
        List<AppletVip> appletVips = appletVipService.selectAppletVipList();
        return getDataTable(appletVips);
    }

//    /**
//     * 获取【请填写功能名称】详细信息
//     */
//    @PreAuthorize("@ss.hasPermi('system:vip:query')")
//    @GetMapping(value = "/{id}")
//    public AjaxResult getInfo(@PathVariable("id") Long id) {
//        return success(appletVipService.selectAppletVipById(id));
//    }

    /**
     * 新增【请填写功能名称】
     */
   @ApiOperation(value = "新增VIP")
    @PostMapping("/addVip")
    public R add(@RequestBody AppletVipVo appletVip) {
        return R.ok(appletVipService.insertAppletVip(appletVip));
    }

    /**
     * 修改【请填写功能名称】
     */
    @ApiOperation(value = "修改VIP")
    @PostMapping("/editVip")
    public R edit(@RequestBody AppletVipVo appletVip) {
        return appletVipService.updateAppletVip(appletVip);
    }

//    /**
//     * 删除【请填写功能名称】
//     */
//
//    @PostMapping("/{ids}")
//    public R remove(@PathVariable Long[] ids) {
//        return R.ok(appletVipService.deleteAppletVipByIds(ids));
//    }
}
